package cn.xuchunh.okhttpdemo;

/**
 * Created by XuChunH on 2015/12/30.
 */
public class Tag {

    private Object requestTag;
    private int id;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Object getRequestTag() {
        return requestTag;
    }

    public void setRequestTag(Object requestTag) {
        this.requestTag = requestTag;
    }

    /**
     * 若requestTag为NULL，说明未设置Request的tag，
     * 这里简单的处理为与任何Tag均不相等,即使有可能ID相同
     * @param o
     * @return 是否相等
     */
    @Override
    public boolean equals(Object o) {
        if (o instanceof Tag) {
            Tag temp = (Tag) o;
            return requestTag != null && requestTag.equals(temp.getRequestTag());
        }
        return false;
    }
}
